/**
 * 
 */
package com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.useroption;

import com.alstudio.module.xmpp.protocol.xmpp.packact.ALXmppDomainConfig;
import com.alstudio.module.xmpp.protocol.xmpp.packact.IQNameSpace;
import com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.AlXmlTag;
import com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.BaseIQTemplate;

/**
 * 获取举报用户iq
 * 
 * @author alonso lee
 * 
 */
public class ChargeUserIQCreator extends BaseIQTemplate {

	private String jid;
	private String reason;
	private String content;

	/**
	 * 
	 */
	public ChargeUserIQCreator(String jid, String reason, String content,
			String domain) {
		// TODO Auto-generated constructor stub
		this.jid = jid;
		this.reason = reason;
		this.content = content;
		this.domain = domain;

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.alstudio.module.xmpp.protocol.xmpp.util.xmlcreator.iq.BaseIQTemplate
	 * #getIQXml()
	 */
	@Override
	public String getIQXml() {
		// TODO Auto-generated method stub

		mALIQCreator.setNs(IQNameSpace.NS_ACCUSATION_CHARGE);
		mALIQCreator.setType(IQ_TYPE_SET);
		to = ALXmppDomainConfig.getALXmppDomainConfig().getDomainByNameSpace(
				IQNameSpace.NS_ACCUSATION_CHARGE);
		mALIQCreator.setTo(to + domain);

		// jid
		AlXmlTag tag = new AlXmlTag("jid");
		tag.setText(jid);
		tagList.add(tag);

		// reason
		tag = new AlXmlTag("reason");
		tag.setText(reason);
		tagList.add(tag);

		// content
		tag = new AlXmlTag("content");
		tag.setText(content);
		tagList.add(tag);

		String xml = "";
		try {
			xml = mALIQCreator.getXml();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return xml;

	}

}
